<%--
  Created by IntelliJ IDEA.
  User: bin.liu
  Date: 2018/12/12
  Time: 16:04
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

<div class="main-content">
    <div class="box box-main">
        <form id="dataCatForm" model="post" action="<c:url value="/web/admin/dataCat/executeDataCatEdit.action"/>" method="post" class="form-horizontal">
            <div class="box-body">
                <div class="form-unit">基本信息</div>
                <input type="hidden" name="id" value="${dataCat.id}"/>
                <input type="hidden" name="createDate1"
                       value="<fmt:formatDate value="${dataCat.createDate}" pattern="yyyy-MM-dd HH:mm:ss"/>"/>
                <div class="row">
                    <div class="col-xs-12">
                        <div class="form-group">
                            <label class="control-label col-sm-4" title="">
                                <span class="required ">*</span> 资料类型名称：<i class="fa icon-question hide"></i></label>
                            <div class="col-sm-8">
                                <input path="dataCatName" name="dataCatName" value="${dataCat.dataCatName}" maxlength="100" class="form-control required ">
                            </div>
                        </div>
                    </div>

                    <div class="col-xs-12">
                        <div class="form-group">
                            <label class="control-label col-sm-4" title="">
                                所属企业：<i class="fa icon-question hide"></i></label>
                            <label class="control-label col-sm-8" style="text-align: left" title="">
                                ${enterprise.enterpriseName}<i class="fa icon-question hide"></i></label>
                        </div>
                    </div>
                </div>
            </div>
            <div class="box-footer">
                <div class="row">
                    <div class="col-sm-offset-2 col-sm-12">
                        <button type="submit" class="btn btn-sm btn-primary" id="btnSubmit"><i class="fa fa-check"></i> 保 存</button>&nbsp;

                        <button type="button" class="btn btn-sm btn-default" id="btnCancel" onclick="closeView()"><i class="fa fa-times"></i> 关 闭</button>
                    </div>
                </div>
            </div>
        </form>
    </div>
</div>
<script>
    $("#dataCatForm").validate({
        submitHandler: function(form){
            js.ajaxSubmitForm($(form), function(data){
                js.showMessage(data.msg);
                if(data.status == Global.NO){
                    closeView();
                    $('#dataGrid').dataGrid("refresh");
                }
            }, "json");
        }
    });

    function closeView() {
        layer.close(LayWin['wDataCat']);
    }
</script>